import captchaAdminApiConfig from '@/core/captcha/generated/apiconfig/captchaAdminApiConfig'
import serverApiMockUtils from '../../utils/serverApiMockUtils'
import mockProdServerUtils from '../../utils/mockUtils'
import { MockMethod } from 'vite-plugin-mock'
import Mock from 'mockjs'
import CaptchaItemResponse from '@/core/captcha/generated/types/model/response/CaptchaItemResponse'

const content: CaptchaItemResponse[] = []
for (let i = 0; i < 10; i++) {
	content.push({
		id: i.toString(),
		captchaAppId: i.toString(),
		code: `code_验证码_${i.toString()}`,
		attemptCount: i,
		expireTime: `expireTime_验证码_${i.toString()}`,
		deleteFlag: '0',
		createTime: new Date().getTime().toString(),
		updateTime: new Date().getTime().toString(),
		rowVersion: 1,
	} as CaptchaItemResponse)
}

const mockList: MockMethod[] = [...serverApiMockUtils.getDefaultServerApi(captchaAdminApiConfig.captchaItem, content)]

mockProdServerUtils.addMockList(...mockList)

export const items = content
